﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using System.ComponentModel;

namespace WpfApplication1
{
    public class MyClass : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private int _val;

        public int Value
        {
            get { return _val; }
            set 
            {
                if (_val == value)
                    return;

                _val = value;

                OnPropertyChanged("Value");
            }
        }

        private int _val1;

        public int Value1
        {
            get { return _val1; }
            set
            {
                if (_val1 == value)
                    return;

                _val1 = value;

                OnPropertyChanged("Value1");
            }
        }

        private void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }

        public override string ToString()
        {
            return Value.ToString();
        }
        
    }
}
